package com.myway.core.common;

import java.util.HashMap;

/**
 *
 *
 * @author vunloon
 * @since 2008-7-14
 **/
public enum EnumMessageType {
	PNL("PNL 报文"), ADL("ADL 报文");

	
	private final String alias;
	private static HashMap<String, EnumMessageType> map = new HashMap<String, EnumMessageType>();
	

	static {
		for (EnumMessageType e : EnumMessageType.values()) {
			map.put(e.alias, e );
		}
	}
	
	EnumMessageType(String alias) {
		this.alias=alias;
	}
	
	@Override
	public String toString() {
		return this.alias;

	}
	
	/**
	 * Return a <code>IdTypeConstants</code> object holding the value of specified alias name
	 * @param alias the alias name of the type
	 * @return a <code>AgentTypeEnum</code> object holding the value represented by the alias name argument
	 */
	public static EnumMessageType valueOfAlias(String alias) {
		EnumMessageType type = map.get(alias);

		if (type == null) {
			throw new IllegalArgumentException("Unknown message type enum alias [" + alias + "]");
		}

		return type;
	}		
}
